from src.application.category.dto import CategoryDTO
from src.domain.server.entities.category import CategoryEntity
from src.infrastructure.db import models

# def convert_db_model_to_category_entity(category: models.Category) -> CategoryEntity:
#     return CategoryEntity(
#         id=category.id,
#         name=category.name,
#         name_eng=category.name_eng,
#         price_4h=category.price_4h,
#         price_1d=category.price_1d,
#         price_1w=category.price_1w,
#         price_2w=category.price_2w,
#         price_1m=category.price_1m,
#     )


def convert_db_model_to_category_dto(category: models.Category) -> CategoryDTO:
    return CategoryDTO(
        id=category.id,
        name=category.name,
        name_eng=category.name_eng,
        price_4h=category.price_4h,
        price_1d=category.price_1d,
        price_1w=category.price_1w,
        price_2w=category.price_2w,
        price_1m=category.price_1m,
    )


def convert_category_entity_to_db_model(category: CategoryEntity) -> models.Category:
    return models.Category(
        id=category.id,
        name=category.name,
        name_eng=category.name_eng,
        price_4h=category.price_4h,
        price_1d=category.price_1d,
        price_1w=category.price_1w,
        price_2w=category.price_2w,
        price_1m=category.price_1m,
    )
